import {
  URL_PATH_HOME
} from "../../utils/UrlPath";

const sdk = getApp().globalData.sdk
Page({

  /**
   * 页面的初始数据
   */
  data: {
    searchIcon:"../../images/icon_search.png",
    searchHint:"股票代码/名称/成员",
    dataList: [{
        "name": "张隐蔽",
        "proportion": "100%",
        "num": "200"
      },
      {
        "name": "迪迦",
        "proportion": "100%",
        "num": "200"
      },
      {
        "name": "陈总",
        "proportion": "100%",
        "num": "200"
      },
      {
        "name": "建坪",
        "proportion": "100%",
        "num": "200"
      },
      {
        "name": "面哥",
        "proportion": "100%",
        "num": "200"
      }, {
        "name": "射射",
        "proportion": "100%",
        "num": "200"
      }, {
        "name": "简小侠",
        "proportion": "100%",
        "num": "200"
      }, {
        "name": "等等",
        "proportion": "100%",
        "num": "200"
      }, {
        "name": "等等等",
        "proportion": "100%",
        "num": "200"
      }, {
        "name": "更多等等等...",
        "proportion": "100%",
        "num": "200"
      },
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {
    sdk.post(URL_PATH_HOME, {})
      .then((res) => {
        console.log(res)
      })
      .catch((error) => {
        console.log(error)
      });
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  },

  /**
   * 去搜索
   */
  toSearch:function(){
    wx.navigateTo({
      url: '/pages/search/index',
    })
  },


  /**
   * 去搜索
   */
  toPersonDetail: function (event) {
    var personItemData = event.detail;
    wx.navigateTo({
      url: '/pages/person-detail/index?name=' + personItemData.name,
    })
  },
})
